<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo ($title); ?></title>
    <meta name="keywords" content="<?php echo ($title); ?>">
    <meta name="description" content="<?php echo ($title); ?>">
    <link href="/Public/static/admin/css/bootstrap.min.css" rel="stylesheet">
    <link href="/Public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/Public/static/admin/css/style.css" rel="stylesheet">
    <link href="/Public/static/admin/css/plugins/treeview/bootstrap-treeview.css" rel="stylesheet">
    <style type="text/css">
        .my_right{
            float: right;
        }
        .my_title{
            font-size: large;
            color: darkslategrey;
        }
    </style>
</head>
<body class="gray-bg">
<div class="row wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>地区列表</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <div class="row">
                    <div class="col-sm-2">
                        <div class="input-group">
                            <a href="<?php echo U('add');?>" class="btn btn-outline btn-primary ">添加地区</a>
                        </div>
                    </div>
                </div>
                <div id="treeview5" class="test treeview">
                    <ul class="list-group">
                        <li class="list-group-item">
                            <span class="my_title">地 区 名</span>
                            <span class="my_right">
                                <span class="my_title">操 作</span>
                                <span class="indent"></span>
                            </span>
                        </li>
                        <?php if(is_array($region_info)): $i = 0; $__LIST__ = $region_info;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li class="list-group-item">
                                <?php
 echo str_repeat('<span class="indent"></span><span class="indent"></span>',$v['level']-1); ?>
                                <span class="icon"><i class="glyphicon glyphicon-star"></i></span>
                                <a href="javascript:;"><?php echo ($v["region_name"]); ?></a>
                                <span class="my_right">
                                    <a href="javascript:;" class="label label-primary" onclick="edit(<?php echo ($v["id"]); ?>)"><i class="fa fa-edit"></i> 编 辑</a>
                                    <a href="javascript:;" class="label label-danger" onclick="del(<?php echo ($v["id"]); ?>)"><i class="fa fa-trash-o"></i> 删 除</a>
                                </span>
                            </li><?php endforeach; endif; else: echo "" ;endif; ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/Public/static/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Public/static/admin/js/plugins/treeview/bootstrap-treeview.js"></script>
<script src="/Public/static/admin/js/common.js"></script>
<script src="/Public/static/admin/js/plugins/layer/layer.min.js"></script>
<script>
    //修改
    function edit(id){
        location.href = '/admin/region/edit/id/'+id+'.html';
    }
    //删除
    function del(id){
        sxshop.del(id,"<?php echo U('del');?>","<?php echo U();?>")
    }
</script>
</body>
</html>